Unity 您所在的位置:网站首页 unity heightmap Unity

Unity

2024-06-28 03:17| 来源: 网络整理| 查看: 265

Unity User Manual 2023.3 (alpha) World building Terrain Working with Heightmaps Grass and other details Terrain settings Working with Heightmaps

Terrain tools that affect height, such as Raise or Lower Terrain and Set Height, use a grayscale texture called a heightmap. Unity represents the height of each point on the TerrainThe landscape in your scene. A Terrain GameObject adds a large flat plane to your scene and you can use the Terrain’s Inspector window to create a detailed landscape. More infoSee in Glossary as a value in a rectangular array. It represents this array using a grayscale heightmapA greyscale Texture that stores height data for an object. Each pixel stores the height difference perpendicular to the face that pixel represents.See in Glossary. Heightmaps are built into the Terrain, and the values stored in a heightmap define the height of each point or vertex on the Terrain.

Example heightmap Importing and exporting heightmaps

You can import and export heightmaps into the Unity Editor. This is useful when you want to use real world height data to replicate a landmark such as Mount Everest, or work on a heightmap image in an external image editor. You can also use 3D modelling applications, such as Houdini and World Machine, to generate Terrain, then import your Terrain into Unity as a heightmap.

It’s good practice to store heightmaps as RAW files. A RAW file uses a 16-bit grayscale format that’s compatible with most image and landscape editors. The Unity Editor enables you to import and export RAW heightmap files for a Terrain.

To access the import and export settings into the Editor, select the Terrain component in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More infoSee in Glossary, and click the Terrain Settings button (gear icon in the toolbar).

Import Raw and Export Raw buttons in the Terrain Settings Inspector

Under Texture Resolutions (On Terrain Data), there are two buttons labelled Import Raw and Export Raw.

Import Raw allows Unity to read a heightmap from the RAW file format, and generate it in the Editor.

Export Raw allows Unity to write a heightmap from the Editor to the RAW file format.

Import and export options Property Description Depth Determines how many bits Unity uses per pixel in the imported or exported heightmap.• Bit 16: Uses 16 bits (2 bytes)• Bit 8: Uses 8 bits (1 byte) Resolution The texture resolution (width and height) of the imported heightmap. Byte Order Determines how Unity orders the bytes for each pixelThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More infoSee in Glossary in the imported or exported heightmap. This mainly applies to bit–16 depth heightmaps, and is platform-dependent. Flip Vertically Determines whether Unity flips the exported heightmap vertically across the x-axis. Terrain Size The size of Terrain that Unity will apply the imported heightmap to.

2020–06–30 Page amended

Updated content to reflect new UI and options

Grass and other details Terrain settings


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有